using System;
using System.Data;
using Utils;
using Utils.DatabaseUtils;


namespace QLBH
{
public class tblCaLamViec_NguoiDungUI
{ 
	private int idCaLamViec_NguoiDung;
	public int IdCaLamViec_NguoiDung
	{
		get { return idCaLamViec_NguoiDung;}
		set { idCaLamViec_NguoiDung = value;}
	}

	private int idCaLamViec;
	public int IdCaLamViec
	{
		get { return idCaLamViec;}
		set { idCaLamViec = value;}
	}

	private int idNhanVien;
	public int IdNhanVien
	{
		get { return idNhanVien;}
		set { idNhanVien = value;}
	}

	private byte ngayLamViec;
	public byte NgayLamViec
	{
		get { return ngayLamViec;}
		set { ngayLamViec = value;}
	}


	private bool hoatDong;
	public bool HoatDong
	{
		get { return hoatDong;}
		set { hoatDong = value;}
	}

	public tblCaLamViec_NguoiDungUI() {}

    public tblCaLamViec_NguoiDungUI(int idCaLamViec_NguoiDung, int idCaLamViec, int idNhanVien, byte ngayLamViec, bool hoatDong)
	 {
		this.idCaLamViec_NguoiDung = idCaLamViec_NguoiDung;
 		this.idCaLamViec = idCaLamViec;
 		this.idNhanVien = idNhanVien;
 		this.ngayLamViec = ngayLamViec;
 		this.hoatDong = hoatDong;
        this.ngayLamViec = ngayLamViec;
 	}

	public int Add(int idCaLamViec, int idNhanVien, byte ngayLamViec, bool hoatDong)
	{
		try
		{
			int result = SqlHelper.ExecuteNonQuery(Common.Conn,"tblCaLamViec_NguoiDung_Add",idCaLamViec,idNhanVien,ngayLamViec,hoatDong);
			return result;
		}
		catch(Exception e) {return -1; }
	}

	public int Update(int idCaLamViec_NguoiDung, int idCaLamViec, int idNhanVien, byte ngayLamViec, bool hoatDong)
	{
		try
		{
			int result = SqlHelper.ExecuteNonQuery(Common.Conn,"tblCaLamViec_NguoiDung_Update",idCaLamViec_NguoiDung,idCaLamViec,idNhanVien,ngayLamViec,hoatDong);
			return result;
		}
		catch(Exception e) {return -1; }
	}

	public int Delete(int idCaLamViec_NguoiDung)
	{
		try
		{
			int result = SqlHelper.ExecuteNonQuery(Common.Conn,"tblCaLamViec_NguoiDung_Delete",idCaLamViec_NguoiDung);
			return result;
		}
		catch(Exception e) {return -1; }
	}

	public int DeleteAll()
	{
		try
		{
			int result = SqlHelper.ExecuteNonQuery(Common.Conn,"tblCaLamViec_NguoiDung_DeleteAll");
			return result;
		}
		catch(Exception e) {return -1; }
	}

	public DataSet Get(int idCaLamViec_NguoiDung)
	{
		try
		{
			DataSet result = SqlHelper.ExecuteDataset(Common.Conn,"tblCaLamViec_NguoiDung_Get",idCaLamViec_NguoiDung);
			return result;
		}
		catch(Exception e) {return null; }
	}

	public DataSet GetAll()
	{
		try
		{
			DataSet result = SqlHelper.ExecuteDataset(Common.Conn,"tblCaLamViec_NguoiDung_GetAll");
			return result;
		}
		catch(Exception e) {return null; }
	}

	public DataSet GetByIdCaLamViec(int idCaLamViec)
	{
		try
		{
			DataSet result = SqlHelper.ExecuteDataset(Common.Conn,"tblCaLamViec_NguoiDung_GetByIdCaLamViec",idCaLamViec);
			return result;
		}
		catch(Exception e) {return null; }
	}

	public DataSet GetByIdNhanVien(int idNhanVien)
	{
		try
		{
			DataSet result = SqlHelper.ExecuteDataset(Common.Conn,"tblCaLamViec_NguoiDung_GetByIdNhanVien",idNhanVien);
			return result;
		}
		catch(Exception e) {return null; }
	}

} 
}
